<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('商户结算账户列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <input type="hidden" name="daMarker" value="2"/>
                        <ul>
                            <li>
                                <label style="width: 80px">开户行名称：</label>
                                <input type="text" name="bankName"/>
                            </li>
                            <li>
                                <label style="width: 80px">结算人：</label>
                                <input type="text" name="screenName"/>
                            </li>
                            <li>
                                <label style="width: 80px">结算卡号：</label>
                                <input type="text" name="screenNum" placeholder="查询后四位"/>
                            </li>
                            <li>
                                <label style="width: 80px">商户编号：</label>
                                <input type="text" name="seqId"/>
                            </li>
                            <li>
                                <label style="width: 80px">预留手机号：</label>
                                <input type="text" name="resphone"/>
                            </li>
                            <li>
                                <label style="width: 80px">账户类型 ：</label>
                                <select name="nature" th:with="type=${@dict.getType('zd_nature')}">
                                    <option value="">请选择</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>

                            <li>
                                <label style="width: 80px">总行名称：</label>
                                <input type="text" name="bankHeadname"/>
                            </li>

                            <li class="select-time">
                                <label style="width: 80px">添加时间：</label>
                                <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginCreatedate]"/>
                                <span>-</span>
                                <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endCreatedate]"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-primary single disabled" onclick="updateSettle()" shiro:hasPermission="accounts:accounts:edit">
                    <i class="fa fa-edit"></i> 变更账户信息
                </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('accounts:accounts:edit')}]];
        var removeFlag = [[${@permission.hasPermi('accounts:accounts:remove')}]];
        var prefix = ctx + "accounts/accounts";
        var zd_nature = [[${@dict.getType('zd_nature')}]];

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "商户结算账户",
                clickToSelect:true,
                columns: [{
                    radio: true
                },
                {
                    field: 'id',
                    title: '编号',
                    visible: false
                },
                {
                    field: 'bankName',
                    title: '开户行名称',
                    formatter:function (value, row, index) {
                        return $.table.tooltip(value,7);
                    }
                },
                {
                    field: 'screenName',
                    title: '结算人'
                },
                {
                    field: 'showScreennum',
                    title: '结算账号'
                },
                {
                    field: 'bankHeadname',
                    title: '总行名称'
                },
                {
                    field: 'showResphone',
                    title: '银行预留手机号'
                },
                {
                    field: 'seqId',
                    title: '商户编号'
                },
                {
                    field: 'showScreenidnum',
                    title: '身份证号'
                },
                {
                    field: 'nature',
                    title: '账户类型 ',
                    align: 'center',
                    formatter: function(value, row, index) {
                        return $.table.selectDictLabel(zd_nature, value);
                    }
                },
                {
                    field: 'acmoney',
                    title: '起始结算金额',
                    formatter: function(value, row, index) {
                        return $.table.rmbFormatter(value);
                    }
                },
                {
                    field: 'areaName',
                    title: '账户开户地'
                },
                {
                    field: 'note',
                    title: '备注'
                },
                {
                    field: 'createman',
                    title: '添加人'
                },
                {
                    field: 'createdate',
                    title: '添加时间'
                },]
            };
            $.table.init(options);
        });
        function updateSettle() {
            var id = $.table.selectColumns("id")
            if ($.common.isEmpty(id)) {
                $.modal.alertWarning("请至少选择一条记录");
                return;
            }
            $.modal.open("变更账户信息",prefix + "/updateSettle/" + id,'1000');
        }
    </script>
</body>
</html>